package com.lry.basic.proxy.demo3;

import com.lry.basic.proxy.demo2.anno.Feign;
import com.lry.basic.proxy.demo2.anno.RequestMapping;
import lombok.SneakyThrows;

@Feign(serviceName = "user-service")
public class $Proxy extends JProxy implements UserService{

    private JInvocationHandler jInvocationHandler;
    private Class interfaceClass;

    public $Proxy(JInvocationHandler jInvocationHandler,Class interfaceClass){
        this.jInvocationHandler = jInvocationHandler;
        this.interfaceClass = interfaceClass;
    }


    @SneakyThrows
    @Override
    @RequestMapping(url = "/user/queryUserById/{id}")
    public void queryUserById(Integer id) {
        jInvocationHandler.invoke(this,interfaceClass.getDeclaredMethod("queryUserById",Integer.class),new Object[]{1});
    }
}
